home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / PictUtils.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  8.7 KB  |  233 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        PictUtils.p
  3.  
  4.      Contains:    Picture Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1990-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT PictUtils;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __PICTUTILS__}
  28. {$SETC __PICTUTILS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC PictUtilsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __PALETTES__}
  38. {$I Palettes.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. { verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls }
  47.  
  48. CONST
  49.     returnColorTable            = $0001;
  50.     returnPalette                = $0002;
  51.     recordComments                = $0004;
  52.     recordFontInfo                = $0008;
  53.     suppressBlackAndWhite        = $0010;
  54.  
  55.                                                                 {  color pick methods  }
  56.     systemMethod                = 0;                            {  system color pick method  }
  57.     popularMethod                = 1;                            {  method that chooses the most popular set of colors  }
  58.     medianMethod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                                                                 {  color bank types  }
  60.     ColorBankIsCustom            = -1;
  61.     ColorBankIsExactAnd555        = 0;
  62.     ColorBankIs555                = 1;
  63.  
  64.  
  65. TYPE
  66.     PictInfoID                            = LONGINT;
  67.     CommentSpecPtr = ^CommentSpec;
  68.     CommentSpec = RECORD
  69.         count:                    INTEGER;                                {  number of occurrances of this comment ID  }
  70.         ID:                        INTEGER;                                {  ID for the comment in the picture  }
  71.     END;
  72.  
  73.     CommentSpecHandle                    = ^CommentSpecPtr;
  74.     FontSpecPtr = ^FontSpec;
  75.     FontSpec = RECORD
  76.         pictFontID:                INTEGER;                                {  ID of the font in the picture  }
  77.         sysFontID:                INTEGER;                                {  ID of the same font in the current system file  }
  78.         size:                    ARRAY [0..3] OF LONGINT;                {  bit array of all the sizes found (1..127) (bit 0 means > 127)  }
  79.         style:                    INTEGER;                                {  combined style of all occurrances of the font  }
  80.         nameOffset:                LONGINT;                                {  offset into the fontNamesHdl handle for the font’s name  }
  81.     END;
  82.  
  83.     FontSpecHandle                        = ^FontSpecPtr;
  84.     PictInfoPtr = ^PictInfo;
  85.     PictInfo = RECORD
  86.         version:                INTEGER;                                {  this is always zero, for now  }
  87.         uniqueColors:            LONGINT;                                {  the number of actual colors in the picture(s)/pixmap(s)  }
  88.         thePalette:                PaletteHandle;                            {  handle to the palette information  }
  89.         theColorTable:            CTabHandle;                                {  handle to the color table  }
  90.         hRes:                    Fixed;                                    {  maximum horizontal resolution for all the pixmaps  }
  91.         vRes:                    Fixed;                                    {  maximum vertical resolution for all the pixmaps  }
  92.         depth:                    INTEGER;                                {  maximum depth for all the pixmaps (in the picture)  }
  93.         sourceRect:                Rect;                                    {  the picture frame rectangle (this contains the entire picture)  }
  94.         textCount:                LONGINT;                                {  total number of text strings in the picture  }
  95.         lineCount:                LONGINT;                                {  total number of lines in the picture  }
  96.         rectCount:                LONGINT;                                {  total number of rectangles in the picture  }
  97.         rRectCount:                LONGINT;                                {  total number of round rectangles in the picture  }
  98.         ovalCount:                LONGINT;                                {  total number of ovals in the picture  }
  99.         arcCount:                LONGINT;                                {  total number of arcs in the picture  }
  100.         polyCount:                LONGINT;                                {  total number of polygons in the picture  }
  101.         regionCount:            LONGINT;                                {  total number of regions in the picture  }
  102.         bitMapCount:            LONGINT;                                {  total number of bitmaps in the picture  }
  103.         pixMapCount:            LONGINT;                                {  total number of pixmaps in the picture  }
  104.         commentCount:            LONGINT;                                {  total number of comments in the picture  }
  105.         uniqueComments:            LONGINT;                                {  the number of unique comments in the picture  }
  106.         commentHandle:            CommentSpecHandle;                        {  handle to all the comment information  }
  107.         uniqueFonts:            LONGINT;                                {  the number of unique fonts in the picture  }
  108.         fontHandle:                FontSpecHandle;                            {  handle to the FontSpec information  }
  109.         fontNamesHandle:        Handle;                                    {  handle to the font names  }
  110.         reserved1:                LONGINT;
  111.         reserved2:                LONGINT;
  112.     END;
  113.  
  114.     PictInfoHandle                        = ^PictInfoPtr;
  115.     InitPickMethodProcPtr = ProcPtr;  { FUNCTION InitPickMethod(colorsRequested: SInt16; VAR dataRef: UInt32; VAR colorBankType: SInt16): OSErr; }
  116.  
  117.     InitPickMethodUPP = UniversalProcPtr;
  118.  
  119. CONST
  120.     uppInitPickMethodProcInfo = $00000FA0;
  121.  
  122. FUNCTION NewInitPickMethodProc(userRoutine: InitPickMethodProcPtr): InitPickMethodUPP;
  123.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  124.     INLINE $2E9F;
  125.     {$ENDC}
  126.  
  127. FUNCTION CallInitPickMethodProc(colorsRequested: SInt16; VAR dataRef: UInt32; VAR colorBankType: SInt16; userRoutine: InitPickMethodUPP): OSErr;
  128.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  129.     INLINE $205F, $4E90;
  130.     {$ENDC}
  131.  
  132. TYPE
  133.     RecordColorsProcPtr = ProcPtr;  { FUNCTION RecordColors(dataRef: UInt32; VAR colorsArray: RGBColor; colorCount: SInt32; VAR uniqueColors: SInt32): OSErr; }
  134.  
  135.     RecordColorsUPP = UniversalProcPtr;
  136.  
  137. CONST
  138.     uppRecordColorsProcInfo = $00003FE0;
  139.  
  140. FUNCTION NewRecordColorsProc(userRoutine: RecordColorsProcPtr): RecordColorsUPP;
  141.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  142.     INLINE $2E9F;
  143.     {$ENDC}
  144.  
  145. FUNCTION CallRecordColorsProc(dataRef: UInt32; VAR colorsArray: RGBColor; colorCount: SInt32; VAR uniqueColors: SInt32; userRoutine: RecordColorsUPP): OSErr;
  146.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  147.     INLINE $205F, $4E90;
  148.     {$ENDC}
  149.  
  150. TYPE
  151.     CalcColorTableProcPtr = ProcPtr;  { FUNCTION CalcColorTable(dataRef: UInt32; colorsRequested: SInt16; colorBankPtr: UNIV Ptr; VAR resultPtr: CSpecArray): OSErr; }
  152.  
  153.     CalcColorTableUPP = UniversalProcPtr;
  154.  
  155. CONST
  156.     uppCalcColorTableProcInfo = $00003EE0;
  157.  
  158. FUNCTION NewCalcColorTableProc(userRoutine: CalcColorTableProcPtr): CalcColorTableUPP;
  159.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  160.     INLINE $2E9F;
  161.     {$ENDC}
  162.  
  163. FUNCTION CallCalcColorTableProc(dataRef: UInt32; colorsRequested: SInt16; colorBankPtr: UNIV Ptr; VAR resultPtr: CSpecArray; userRoutine: CalcColorTableUPP): OSErr;
  164.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  165.     INLINE $205F, $4E90;
  166.     {$ENDC}
  167.  
  168. TYPE
  169.     DisposeColorPickMethodProcPtr = ProcPtr;  { FUNCTION DisposeColorPickMethod(dataRef: UInt32): OSErr; }
  170.  
  171.     DisposeColorPickMethodUPP = UniversalProcPtr;
  172.  
  173. CONST
  174.     uppDisposeColorPickMethodProcInfo = $000000E0;
  175.  
  176. FUNCTION NewDisposeColorPickMethodProc(userRoutine: DisposeColorPickMethodProcPtr): DisposeColorPickMethodUPP;
  177.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  178.     INLINE $2E9F;
  179.     {$ENDC}
  180.  
  181. FUNCTION CallDisposeColorPickMethodProc(dataRef: UInt32; userRoutine: DisposeColorPickMethodUPP): OSErr;
  182.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  183.     INLINE $205F, $4E90;
  184.     {$ENDC}
  185. FUNCTION GetPictInfo(thePictHandle: PicHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  186.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  187.     INLINE $303C, $0800, $A831;
  188.     {$ENDC}
  189. FUNCTION GetPixMapInfo(thePixMapHandle: PixMapHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  190.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  191.     INLINE $303C, $0801, $A831;
  192.     {$ENDC}
  193. FUNCTION NewPictInfo(VAR thePictInfoID: PictInfoID; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  194.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  195.     INLINE $303C, $0602, $A831;
  196.     {$ENDC}
  197. FUNCTION RecordPictInfo(thePictInfoID: PictInfoID; thePictHandle: PicHandle): OSErr;
  198.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  199.     INLINE $303C, $0403, $A831;
  200.     {$ENDC}
  201. FUNCTION RecordPixMapInfo(thePictInfoID: PictInfoID; thePixMapHandle: PixMapHandle): OSErr;
  202.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  203.     INLINE $303C, $0404, $A831;
  204.     {$ENDC}
  205. FUNCTION RetrievePictInfo(thePictInfoID: PictInfoID; VAR thePictInfo: PictInfo; colorsRequested: INTEGER): OSErr;
  206.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  207.     INLINE $303C, $0505, $A831;
  208.     {$ENDC}
  209. FUNCTION DisposePictInfo(thePictInfoID: PictInfoID): OSErr;
  210.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  211.     INLINE $303C, $0206, $A831;
  212.     {$ENDC}
  213. {$IFC OLDROUTINENAMES }
  214. FUNCTION DisposPictInfo(thePictInfoID: PictInfoID): OSErr;
  215.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  216.     INLINE $303C, $0206, $A831;
  217.     {$ENDC}
  218. {$ENDC}  {OLDROUTINENAMES}
  219.  
  220.  
  221.  
  222.  
  223. {$ALIGN RESET}
  224. {$POP}
  225.  
  226. {$SETC UsingIncludes := PictUtilsIncludes}
  227.  
  228. {$ENDC} {__PICTUTILS__}
  229.  
  230. {$IFC NOT UsingIncludes}
  231.  END.
  232. {$ENDC}
  233.